package org.farng.mp3.object;

import org.farng.mp3.TagUtility;


/**
 * <p>
 * Title:
 * </p>
 * 
 * <p>
 * Description:
 * </p>
 * 
 * <p>
 * Copyright: Copyright (c) 2002
 * </p>
 * 
 * <p>
 * Company:
 * </p>
 *
 * @author Eric Farng
 * @version $Revision: 1.5 $
 */
public class ObjectStringDate extends ObjectStringFixedLength {
    /**
     * Creates a new ObjectStringDate object.
     *
     * @param identifier DOCUMENT ME!
     */
    public ObjectStringDate(String identifier) {
        super(identifier, 8);
    }

    public ObjectStringDate(ObjectStringDate object) {
        super(object);
    }

    /**
     * DOCUMENT ME!
     *
     * @param value DOCUMENT ME!
     */
    public void setValue(Object value) {
        if (value != null) {
            this.value = TagUtility.stripChar(value.toString(), '-');
        }
    }

    /**
     * DOCUMENT ME!
     *
     * @return DOCUMENT ME!
     */
    public Object getValue() {
        if (value != null) {
            return TagUtility.stripChar(value.toString(), '-');
        } else {
            return null;
        }
    }

    public boolean equals(Object obj) {
        if (obj instanceof ObjectStringDate == false) {
            return false;
        }

        return super.equals(obj);
    }
}